home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3018 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.5 KB

  1. Path: newsfeed.internetmci.com!xmission!news
  2. From: tknarr@xmission.com  ( Todd Knarr )
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  4. Subject: Re: Hungarian notation
  5. Date: 21 Jan 1996 18:08:27 GMT
  6. Organization: Chaos Central
  7. Message-ID: <4dtver$hf4@news.xmission.com>
  8. References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com> <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com> <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie> <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg> <4bd <4cf8hf$8fe@hopi.gate.net> <4cgq30$c0v@weck.brokersys.com> <4cvu68$2jb@macaw.cyberport.com> <4d21og$iab@news.xmission.com> <4djm1o$kf3@gaia.ns.utk.edu>
  9. Reply-To: tknarr@xmission.com ( Todd Knarr )
  10. NNTP-Posting-Host: slc65.xmission.com
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <4djm1o$kf3@gaia.ns.utk.edu>, mbk@I_should_put_my_domain_in_etc_NNTP_INEWS_DOMAIN (Matthew B. Kennel) writes:
  14. >Indeed I agree.  I find that I do not always enjoy even having to manifestly
  15. >declare types for variables everywhere.  I like static type inference as in
  16. >Eiffel and Sather (and others), where the static type of a variable is
  17. >derived from the types of other parts of the system.
  18.  
  19. I'm not sure that's neccesarily good either. If you do pure inference, you
  20. can end up with code that doesn't compile or doesn't work right and the
  21. error messages are far removed from the actual cause. By declaring the type
  22. explicitly, I'm declaring to the world what the code that uses that variable
  23. is willing to put up with in terms of semantics. By declaring the appropriate
  24. constructors and conversion member functions in my own classes, I provide
  25. or do not provide a map of what can be treated as what and what can't. If I
  26. do make a change somewhere that results in handing code a variable with
  27. semantics different from what it's prepared to handle, I get my error
  28. messages at exactly the point I handed it the variable. At that point I
  29. check to see whether I made a mistake and am passing in something wrong,
  30. or whether I need to rewrite the code to handle a different type. With
  31. inference, I get errors at use points well away from the point I probably
  32. need to look at.
  33.  
  34. --
  35. Todd Knarr : tknarr@xmission.com      |  finger for PGP public key
  36.                                       |  Member, USENET Cabal
  37.  
  38. Seriously, I don't want to die just yet.  I don't care how
  39. good-looking they are, I! don't! want! to! die!"
  40.                                         -- Megazone ( UF1 )
  41.  
  42.